package au.com.carboncycle.gb;


import java.awt.event.KeyEvent;

import au.com.carboncycle.gb.engine.Input.Key;

class AWTKeyToInputMapper {

	public Key mapToInputKey (int key) {
		Key button = Key.NO_KEY;
		
        if (key == KeyEvent.VK_UP) button = Key.UP;
        if (key == KeyEvent.VK_LEFT) button = Key.LEFT;
        if (key == KeyEvent.VK_DOWN) button = Key.DOWN;
        if (key == KeyEvent.VK_RIGHT) button = Key.RIGHT;

        if (key == KeyEvent.VK_NUMPAD8) button = Key.UP;
        if (key == KeyEvent.VK_NUMPAD4) button = Key.LEFT;
        if (key == KeyEvent.VK_NUMPAD2) button = Key.DOWN;
        if (key == KeyEvent.VK_NUMPAD6) button = Key.RIGHT;

        if (key == KeyEvent.VK_Z) button = Key.JUMP;
        if (key == KeyEvent.VK_X) button = Key.LOW_KICK;
        if (key == KeyEvent.VK_C) button = Key.LOW_PUNCH;
        if (key == KeyEvent.VK_S) button = Key.HIGH_KICK;
        if (key == KeyEvent.VK_D) button = Key.HIGH_PUNCH;

        if (key == KeyEvent.VK_ESCAPE) button = Key.ESCAPE;

        
        return button;
	}
	
}
